package com.example.administrator.myapplication.model;



import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.SimpleFormatter;

/**
 * Created by Administrator on 2017/7/16 0016.
 * 好友关系
 */

public class FriendsRelationship implements Serializable {

    public FriendsRelationship(Contacts we){
        this.setWe(we);
    }

    public Contacts getWe() {
        return we;
    }

    public void setWe(Contacts we) {
        this.we = we;
    }

    public Contacts getFriends() {
        return friends;
    }

    public void setFriends(Contacts friends) {
        this.friends = friends;
    }

    public String getRelationshipState() {
        return relationshipState;
    }

    public void setRelationshipState(String relationshipState) {
        if(relationshipState == null) {
            this.relationshipState = RelationshipState.Stranger.toString();
        }else {
            this.relationshipState = relationshipState;
        }
    }

    public String getStateChangeTime() {
        return stateChangeTime;
    }

    public void setStateChangeTime(String stateChangeTime) {
        if(stateChangeTime == null){
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date    curDate    =   new    Date(System.currentTimeMillis());//获取当前时间
            String    str    =    simpleDateFormat.format(curDate);
            this.stateChangeTime = str;
        }
        this.stateChangeTime = stateChangeTime;
    }

    private Contacts we; //我是谁
    private Contacts friends; //我的好友
    private String relationshipState;
    private String stateChangeTime;    // 好友关系改变的时间

    private Contacts[] friendsCluster; //好友集群


    /**
     * 查询我总共有多少好友
     *
     * @return 由所有好友组成的集群
     */
    public final  Contacts[] getFriendsCluster(){

        return friendsCluster;
    }


    enum    RelationshipState{
        Say_Hello,   //仅仅打过招呼而已
        TwoWay_Friend, //双向好友
        OneWay_Friend, //他是我的好友，但我却不是他的好友
        Stranger, //从来都没交流过，陌生人而已
        Have_Broken_Up, //之前是好友，但现在已经删除了
        Black_List       //黑名单，被我主动屏蔽了的
    }
}
